package com.example.gfsquadwebviewproject.m_enum;

import java.util.HashMap;

public class GlobalHodler {

    HashMap<Object, Object> hashMap = new HashMap<>();
    static private GlobalHodler globalHodler;

    static public GlobalHodler instance(){
        if (globalHodler==null){
            globalHodler = new GlobalHodler();
        }
        return globalHodler;
    }

    public Object getHashMap(Object name){
        return hashMap.get(name);
    }

    public void setHashMap(Object name, Object value){
        hashMap.remove(name);
        hashMap.put(name,value);
    }

    public int getHashMapCount(){
        return hashMap.size();
    }

    public void deleteHashMap(Object name){
        hashMap.remove(name);
    }

    public void recycle(){
        globalHodler = null;
        if(hashMap!=null) {
            hashMap.clear();
            hashMap = null;
        }
    }

}
